package cn.edu.scau.sec.rw.view;

import javafx.scene.Node;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.MenuItem;


public class GlobalMenu extends ContextMenu {

        private static GlobalMenu menu = null;
        private static Node node = null;

        private GlobalMenu(){
            MenuItem open = new MenuItem("打开");
            MenuItem createCatalog = new MenuItem("新建目录");
            MenuItem createFile = new MenuItem("新建文件");
            MenuItem copy = new MenuItem("复制");
            MenuItem paste = new MenuItem("粘贴");
            MenuItem delete = new MenuItem("删除");

            getItems().add(open);
            getItems().add(createCatalog);
            getItems().add(createFile);
            getItems().add(copy);
            getItems().add(paste);
            getItems().add(delete);
        }

        public static GlobalMenu getInstance(){
            if (menu == null) {
                menu = new GlobalMenu();
            }
            return menu;
        }


    public static GlobalMenu getInstance(Node _node) {
        if (menu == null) {
            menu = new GlobalMenu();
        }
        node = _node;

        return menu;
    }
}


